import request from "../util/request";
//添加广告的请求
export const addAdvRequest = (myForm) => {
  return request.post('/addAdv', myForm)
}
//查询广告的请求
export const advListRequest = (pageNo, everyNum) => {
  return request.get(`/advList/${pageNo}/${everyNum}`)
  
}

//删除广告的请求
export const deleteAdvRequest = (_id) => {
  //将需要作为标记的_id随请求发出
  return request.delete('/deleteAdv', {
    params: {
      _id
    }
  })
}
//更新广告时 获取当前广告信息
export const getUpdateDataRequest = (_id) => {
  //将需要作为标记的_id随请求发出
  return request.get('/getUpdateData', {
    params: {
      _id
    }
  })
}
//更新广告逻辑,put请求和post类似，第一个参数为接口地址，第二个参数为请求体，带三个参数为配置对象
export const setUpdateAdvRequest = (FormData, _id) => {
  return request.put("/updateAdv", FormData, {
    params: {
      _id
    }
  })
}